const TokenKey = 'access_token'
import Cookies from 'js-cookie'

const storage = {
    set(key, value) {
        sessionStorage.setItem(key, JSON.stringify(value))
    },
    get(key) {
        return JSON.parse(sessionStorage.getItem(key))
    },
    remove(key) {
        sessionStorage.removeItem(key)
    },
    getToken() {
        return Cookies.get(TokenKey)
    },
    setToken (token) {
        return Cookies.set(TokenKey, token)
      },
      removeToken () {
        return Cookies.remove(TokenKey)
      }

}
export default storage
